home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Frameworks / ShowcaseApp 1.2a / ExampleDemo.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-21  |  1.3 KB  |  79 lines  |  [TEXT/KAHL]

  1. /******************************************************************************
  2.  ExampleDemo.c
  3.     
  4.     This is a simple example of showcasing a subclass of CPane (all it does is 
  5.     fill its content with gray).
  6.     
  7.     AUTHOR: Andrew_Gilmartin@Brown.Edu
  8.     MODIFIED: 93-10-21
  9.  
  10. ******************************************************************************/
  11.  
  12.  
  13. #include <CDecorator.h>
  14. #include "CSApplication.h"
  15. #include "ExampleDemo.h"
  16.  
  17.  
  18. void CExamplePane::IExamplePane
  19.     ( CView *anEnclosure
  20.     , CBureaucrat *aSupervisor
  21.     , short aWidth
  22.     , short aHeight
  23.     , short aHEncl
  24.     , short aVEncl
  25.     , SizingOption aHSizing
  26.     , SizingOption aVSizing )
  27. {
  28.     IPane
  29.         ( anEnclosur
  30.         , aSupervisor
  31.         , aWidth
  32.         , aHeight
  33.         , aHEncl
  34.         , aVEncl
  35.         , aHSizing
  36.         , aVSizing );
  37.  
  38. } /* IExamplePane */
  39.  
  40.  
  41.  
  42. void CExamplePane::Draw( Rect *area )
  43. {
  44.     FillRect( area, ltGray );
  45.  
  46. } /* Draw */
  47.  
  48.  
  49.  
  50. void CExampleDemoDir::INewDemo( CDirectorOwner *aSupervisor )
  51. {
  52.     extern CDesktop *gDesktop;
  53.     extern CDecorator *gDecorator;
  54.  
  55.     inherited::INewDemo( aSupervisor );
  56.     
  57.     itsWindow = new CWindow;
  58.     itsWindow->IWindow( 128, FALSE, gDesktop, this );
  59.  
  60.     itsPane = new CExamplePane;
  61.     itsPane->IExamplePane
  62.         ( itsWindow
  63.         , itsWindow->itsSupervisor
  64.         , 0
  65.         , 0
  66.         , 0
  67.         , 0
  68.         , sizELASTIC
  69.         , sizELASTIC );
  70.     itsPane->FitToEnclFrame( TRUE, TRUE );
  71.     
  72.     gDecorator->StaggerWindow( itsWindow );
  73.     itsWindow->Select();
  74.  
  75. } /* INewDemo */
  76.  
  77.  
  78.  
  79.